<?php
/**
 * 用户和部门相关
 * Created by PhpStorm.
 * User: 刘抱
 * Date: 2018/11/9
 * Time: 15:13
 */

namespace Home\Services;


class UserService extends BaseService
{
    public static $table = 'db_user';
    public static $table2 = 'db_department';

    /**
     * 获取部门数组列
     * @param $field
     * @param $where
     * @return mixed
     */
    public static function getDepartMentArray($field, $where)
    {
        $result = parent::getResult(self::$table2, $field, $where);
        return $result;
    }

    /**
     * 获取部门单列信息
     * @param $field
     * @param $where
     * @return mixed
     */
    public static function getDepartMent($field, $where)
    {
        $result = parent::getResultByField(self::$table2, $field, $where);
        return $result;
    }

    //获取用户的field指定值
    public static function getUserByField($field, $param)
    {
        $where['id'] = $param;
        $result = parent::getResultByField(self::$table, $field, $where);
        if (!empty($result)) return $result[$field];
        return false;
    }

}